package com.minhua.jijiehao2.mainframe.circle.productTypeActivity.impl

import com.minhua.jijiehao2.base.BaseMvpPresenter
import com.minhua.jijiehao2.bean.BaseBean
import com.minhua.jijiehao2.bean.ProductTypeBean
import com.minhua.jijiehao2.http.CallBack
import com.minhua.jijiehao2.http.ParamsMap
import com.minhua.jijiehao2.mainframe.circle.productTypeActivity.imp.IProductTypePresenter
import com.minhua.jijiehao2.mainframe.circle.productTypeActivity.imp.IProductTypeView

class ProductTypePresenter : BaseMvpPresenter<IProductTypeView>(), IProductTypePresenter {

    private val mProductTypeModel = ProductTypeModel()

    override fun getProductTypes() {
        val map = ParamsMap()
        map.put("parentId", "26")
        mProductTypeModel.getProductTypes(map, object : CallBack<List<ProductTypeBean>>() {
            override fun onSuccess(t: BaseBean<List<ProductTypeBean>>) {
                v?.onTypeSuccess(t.data!!)
            }
        })
    }
}